<template>
	<view class="main">
		<!-- <view class="common_title">
			<van-icon style="margin-left: 10px;" :name="leftIcon" @click="onClickLeft" />
			<view class="title">
				<label class="label-content">站点详情</label>
			</view>
		</view> -->
		<navbar id='navbar' class="header" back title="站点详情" @goBack="goBack" />
		<view id='location' class="location_content">
			<span class='leftspan'>{{locationInfo}}</span>
			<span class='rightspan' @click='getUpadateLocation()'>重新定位</span>
		</view>
		<view class="bottom_station_info" id="bottom-station">
			<view class="bottom_total">
				<view class="station_title van-clearfix">
					<van-icon style="float: left; margin-top: 5px; margin-right: 5px;" :name="titleIcon" />
					<span class='title_p_bottom'>{{stataion.stataionTaskName}}</span>
				</view>
				<!-- 下边框 -->
				<div class="van-hairline--bottom" style='margin-top: 5px;'></div>
				<div class='bottom_content'>
					<p><span>站点名称:</span>{{stataion.stataionName}}</p>
					<p><span>站点类型:</span>{{stataion.stataionType}}</p>
					<p><span>电压等级:</span>{{stataion.stataionLevel}}</p>
					<p><span>投运年限:</span>{{stataion.stataionAge}}</p>
					<p><span>地理区域:</span>{{stataion.stataionCity}}</p>
					<p><span>具体位置:</span>{{stataion.stataionLoaction}}</p>
				</div>
			</view>

		</view>
	</view>
</template>

<script>
	import iscpInfo from '@/common/serverUrl.js'
	import navbar from "../../components/common/nav-bar";

	export default {
		components: {
			mTitle,
			navbar
		},
		data() {
			return {
				leftIcon: require('../../../../static/img/distributionNetworkDaily/img/drawable-xxhdpi_left-arrow.png'),
				titleIcon: require('../../../../static/img/distributionNetworkDaily/img/icon_station_info.png'),
				stataion: {
					'stataionTaskName':'10kV875山水林语I 配电室这是工单名称配电室这是工单名称',
					'stataionName': '侯村站',
					'stataionType': '独立通信站',
					'stataionLevel': '500kV',
					'stataionAge': '2020',
					'stataionCity': '太原',
					'stataionLoaction': '太原市小店区平阳南路',
					'lng': 116.397228,
					'lat': 39.909604,
				},
				bottomDivTop: 0,
				navbarHeight:0,
				locatinHeight:0,
				locationInfo: '山西省太原市小店区体育西路1',

			}
		},
		onLoad() {},
		mounted() {
			console.log('mounted执行了')
			let query = uni.createSelectorQuery();
			let dom = query.select('#bottom-station')
			let that_ = this;
			dom.boundingClientRect(function(res) {
				//res:{left,top,right,bottom,width,height}
				console.log(res)
				that_.bottomDivTop = res.top;
				console.log(that_.bottomDivTop, '高度');

			}).exec(function() {
				//上述布局位置信息获取成功后执行的回调函数
			})
			let navbar = query.select('#navbar')
			navbar.boundingClientRect(function(res) {
				//res:{left,top,right,bottom,width,height}
				console.log(res)
				that_.navbarHeight = res.height;
				console.log(that_.navbarHeight, 'titlebarHeight');
			
			}).exec(function() {
				//上述布局位置信息获取成功后执行的回调函数
			})
			let location = query.select('#location')
			location.boundingClientRect(function(res) {
				//res:{left,top,right,bottom,width,height}
				console.log(res)
				that_.locatinHeight = res.height;
				console.log(that_.locatinHeight, 'locationHeight');
			
			}).exec(function() {
				//上述布局位置信息获取成功后执行的回调函数
			})
			this.initMap();
			this.openMap();
		},
		beforeDestroy() {
			// uni.showToast({
			// 	title: 'beforeDestroy组件周期',
			// 	icon: 'none'
			// })
		},
		destroyed() {
			// 关键步骤：关闭地图
			this.closeMap();
			// uni.showToast({
			// 	title: 'destroyed组件周期',
			// 	icon: 'none'
			// })
		},
		methods: {
			// 初始化地图
			async initMap() {
				console.log('-------start init map--------')
				console.log(iscpInfo, 'wx对象');
				let that_ = this;
				console.log(that_)
				// 1.初始化地图
				await iscpInfo.wx.invoke("ext_SGMap_init", {
					"data": {
						"function": 'init',
						"data": {}
					}
				}, function(res) {
					///结果返回
					console.log("ext_SGMap_init", res);
				})
			},

			// 打开地图
			async openMap() {
				let that_ = this;
				var heightSize = (document.documentElement.clientHeight * 2) / 3;
				var widthSize = (document.documentElement.clientWidth * 3);
				var top = 0;
				var left = 100;

				let u = navigator.userAgent;
				let isAndroid = u.indexOf("Android") > -1 || u.indexOf("Linux") > -1; //g
				let isIOS = !!u.match(/\(i[^;]+;( U;)? CPU.+Mac OS X/); //ios终端

				console.log(document.documentElement.clientWidth)
				heightSize = this.bottomDivTop - this.navbarHeight - this.locatinHeight;

				if (isAndroid) {
					//这个是安卓操作系统
					heightSize = heightSize * window.devicePixelRatio;
					widthSize = widthSize * window.devicePixelRatio;
					left = 100 * window.devicePixelRatio;
					top = (this.navbarHeight + this.locatinHeight) * window.devicePixelRatio;
				}
				if (isIOS) {
					//这个是ios操作系统
				}
				console.log("height", heightSize, "width", widthSize);
				await iscpInfo.wx.invoke(
					"ext_SGMap_Operation", {
						"data": {
							"function": "open",
							"data": {
								"left": 0,
								"top": top,
								"width": widthSize,
								"height": heightSize,
								// "height": 100,
								// "fullScreenShow": true,
								"lng": 116.397228,
								"lat": 39.909604
							}
						}
					},
					function(res) {
						console.log("ext_SGMap_Operation", res);
						that_.baseSetting();
						that_.addMarks();
					}
				);
			},
			// 地图基本设置
			async baseSetting() {
				console.log('基本设置')
				await iscpInfo.wx.invoke("ext_SGMap_Operation", {
					"data": {
						"function": 'setting',
						"data": {
							'showCompass': false, //是否显示指南针, 默认YES
							'enableScroll': false, //是否支持旋转, 默认true
							'showRoadNet': false //是否显示路网信息, 默认为true
						}
					}
				}, function(res) {
					console.log('base set', res);
				})
			},
			// 添加标记
			async addMarks() {
				console.log('添加标记')
				let imagePath =
					'iVBORw0KGgoAAAANSUhEUgAAAGoAAAB3CAYAAADradXSAAAgAElEQVR4XuV9eZRkZ3Xf737vvXq1dvW+aSTNCO0CS2IRYMsgDAizGRKjYAR4ASzj3ZDl2EmcKLFP7CTn5J9gs8SOiTFGIIyxFRYJ2wgDwdhhEUHySCyaYWa6p/euvV699+7Nud+rqqleZrqrunsW8Z3Tp7q76lW993517/3d5buXcAksEVD3NP/DvWd+13/e+OjGvzdfz2M3yYZ//ft7u38TYeNzF/G9OPdFXoAT3wJKB4iJJcIT1xJG1gj5anLeC43kMTex/XXUlhIgpjLJYzUvWBsRXPuEYGki+Z8CeQmAd1EA1QVHpUWB2QxKNW+QaRIaaQM/IAS+gRcS6mFy/l52++sI6wkYWU9QCxgFTxD4gkyT0UgL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IM0dKfW2uSPSAGuS4NvH3NFB3KeLAqgNfpdG4zs+l4IVOykI6UzgrFGCEbsFm+6Hla4hSkJNOYiTI6MqU1xo7Xzi57RE0+aAhonKICp3c0eagdWgqmNq+507ekoDtSNYUZgODLKG3RyRFGyOqx0n1OQj2dmMdgZWh0wwhEIkGdqqUVquKYlO1LvXR2oGzf3MHT3lgdoRLCf2AzYZCiXbTZsYzoGRZWPSENY0vgtSMkERWEJjEKid0kh3b9Q7RV4DbtRENW51K4P2KXf0fQHUOcHa6GulSaKMBnfBJk0qTUaBatNzZgaZUAgtMAKNdotxmhLFTd9xk0iD5o468bp9zB193wB1VrA6tRma4xJK2Si8sZH4FNh4pERCTBKgJWYhxNAqSnJbwmHgU6qFuBnA9UPUm+HF4MjuFtSLhkxsd8Jnrc3QdL8buRqF16YQgZNyQeyS2ieOEqCMyxLFDM9EfhiHcLwQQRgi40Q2qNpby3ABHdmnBFBbJEtrMzrpfgXFC12IVXWOfYxbBk4q+fLFLYGTYrgRI3a0uijuRr3zVe6myS8BkC4aP2qnb9WGKEYnZaIZ5GreoFkyKKYNAt/ACwn1MAEq6wlCT+AHjFKTkS4yFKAOYTjPQdWdrnGn5y9q1bf55LcA1pGwfJWw0EiuJac7f7TIaymZLzGVEVTzYgOqPWkJ+y3towBypxt50M9fUkB1bsYGwPSfST18shQ8XQpKZ6n06Pr399rHSwmgziVckkBt9+3tgrfpyUsRlO2u7/8Dss+jRDk/ZREAAAAASUVORK5CYII='
				await iscpInfo.wx.invoke("ext_SGMap_Operation", {
					"data": {
						"function": 'addMarkers',
						"data": { ///image_id，可不传，相同 image_id 为同一个 image,节省内存 使用 
							"showAllMarkers": true,
							"points": [{
								"id": "10001",
								// "lng": 116.397228,
								// "lat": 39.909604,
								"lng": this.stataion.lng,
								"lat": this.stataion.lat,
								"image_id": "1",
								"img": imagePath,
								"title": '',
								"draggable": false,
							}]
						}
					}
				}, function(res) {
					console.log("ext_SGMap_addmark", res);
				})
			},
			// 更新定位
			async getUpadateLocation() {
				let that_ = this;
				await new Promise((resolve, reject) => {
					iscpInfo.wx.invoke("ext_SGMap_Location", {
						"data": {
							"function": 'checkLocationPermission',
							"data": {}
						}
					}, function(res) {
						// hasLocationPremission 	string 	1已经开启定位权限，0未开启定位权限
						console.log(res, '定位')
						resolve(res)
						// return res.hasLocationPremission
					})
				}).then(function(value) {
					// success
					console.log("执行了success=====" + value)
					if (value.hasLocationPremission === '1') {
						// 开启连续定位
						iscpInfo.wx.invoke("ext_SGMap_Location", {
							"data": {
								"function": 'onceLocation',
								"data": {
									"locationWithReGeocode": true, //连续定位是否返回逆地理信 息，默认 NO。 
									"extLocationProviderEnable": false, //外部定位设备。默认 false 
									"locationTimeout": 2, ///指定单次定位逆地理超时时间,默认为5s。最小值是2s。注意单次定位请求前设置。

								}
							}
						}, function(res) {
							// channelId:"updateLocation"
							console.log('locaion info=======', res.data);
							let infoData = JSON.parse(res.data);
							console.log(infoData);
							that_.locationInfo = infoData.address;
							console.log(that_.locationInfo);
						})
					} else {
						// 打开系统设置界面
						console.log('system set')
						iscpInfo.wx.invoke("ext_SGMap_Location", {
							"data": {
								"function": 'openLocationPermissionSetting',
								"data": {}
							}
						}, function(res) {

						})
					}
				}, function(error) {
					// failure
					console.log("failure失败了" + error)
				})
			},

			locationConfig() {
				console.log("ext_SGMap_Location locationConfig Start");

				iscpInfo.wx.invoke("ext_SGMap_Location", {
						"data": {
							"function": "locationConfig",
							"data": {
								"interval": 2, // Android定位间隔（Android设置有效）
								"locationWithReGeocode": true, //定位时是否需要进行逆地理编码
								"distanceFilter": 100, //定位距离过滤（iOS常规定位设置有效）
								"extLocationProviderEnable": true, //是否开启定位仪拓展定位
								"extLocationInterval": 2 // iOS定位仪拓展定位时间间隔
							}
						}

					},
					function(res) {
						console.log("ext_SGMap_Location completion", res);
					})
			},
			goBack() {
				uni.navigateBack();
			},
			async closeMap() {
				// 关闭地图
				await iscpInfo.wx.invoke(
					"ext_SGMap_Operation", {
						data: {
							function: "close",
							data: {}
						}
					},
					function(res) {
						console.log("ext_SGMap_Operation_close", res);
					}
				);
			}
		},
		onHide() {
			// uni.showToast({
			// 	title: 'onHide页面周期',
			// 	icon: 'none'
			// })
		},
		onUnload() {
			// uni.showToast({
			// 	title: 'onUnload页面周期页面周期',
			// 	icon: 'none'
			// })
			// uni.$emit('emitBack', {'msg':'页面返回'});
		},

		// 浏览器默认返回按键及Android手机实体返回键 不支持 onBackPress()
		// uni.navigateBack会触发onBackPress
		// onBackPress(options) {
		// 	console.log('执行了返回')
		// 	console.log('from:' + options.from)
		// 	if (options.from = 'navigateBack') {
		// 		console.log('返回键')
		// 	} else if (options.from = 'backbutton') {
		// 		console.log('系统返回')
		// 	}
		// 	// 关闭地图
		// 	iscpInfo.wx.invoke(
		// 		"ext_SGMap_Operation", {
		// 			data: {
		// 				function: "close",
		// 				data: {}
		// 			}
		// 		},
		// 		function(res) {
		// 			console.log("ext_SGMap_Operation", res);
		// 			uni.navigateBack({
		// 				delta: 2
		// 			});
		// 		}
		// 	);
		// 	return true;
		// },

	}
</script>

<style lang="scss" scoped>
	* {
		margin: 0;
		padding: 0;
	}

	.main {
		width: 100vw;
		height: 100vh;
		display: flex;
		flex-direction: column;
	}

	.header {
		position: sticky;
		top: 0;
		z-index: 9;
	}

	.location_content {
		background-color: white;
		width: 100vw;
		height: px2vh(138);
		display: flex;
		justify-content: space-between;
		align-items: center;

		.leftspan {
			font-size: px2vw(42);
			margin-left: px2vw(30);
		}

		.rightspan {
			font-size: px2vw(42);
			margin-right: px2vw(30);
			margin-left: px2vw(30);
			min-width: px2vw(200);
			background-color: #ffecec;
			color: #ff5959;
			padding-left: px2vw(30);
			padding-right: px2vw(30);
			padding-top: px2vh(15);
			padding-bottom: px2vh(15);
			border: px2vw(3) solid transparent;
			border-radius: px2vw(150);
			text-align: center;
		}

	}

	.bottom_station_info {
		position: absolute;
		bottom: 0;
		width: 100vw;
		background-color: #fff;
		border-radius: px2vw(30) px2vw(30) 0px 0px;

		.bottom_total {
			margin:px2vw(30);
		}

		.station_title {
			.title_p_bottom {
				font-size: px2vh(48);
				font-weight: 500;

			}
		}

		.bottom_content {
			margin-top: px2vh(30);
		}

		.bottom_content p {
			font-size: px2vw(42);
			margin: px2vw(15);
		}

		.bottom_content span {
			color: gray;
			margin-right: px2vw(30);
		}
	}


</style>
